import request from '@/utils/request'

/**
 * 支付
 */
export function pay(data: AnyObject) {
    // return request.post(`pay`, data, { showErrorMessage: true })
    return request.post(`pay/order/submit`, data, { showErrorMessage: true, isYuDao: true })
}

/**
 * 获取支付信息
 * tradeType: string, tradeId: number, 
 */
export function getPayInfo(params: Record<string, any>) {
    // return request.get(`pay/info/${tradeType}/${tradeId}`, params, { showErrorMessage: true })
    return request.get(`pay/order/get`, params, { isYuDao: true })
}
/**
 * 获取支付方式
 */
export function getEnableChannelCodeList(params: Record<string, any>) {
    return request.get(`pay/channel/get-enable-code-list`, params, { isYuDao: true })
}
/**
 * 获取商城订单详情  不能夸分包调用js
 * @param {any} params 
 * @return 
 */ 
export function getShopOrderDetail(params: any) {
    return request.get(`trade/order/get-detail`, params, { isYuDao: true })

}